package com.colin.aiyi.dao.ImpxUtils3_de;

import com.colin.aiyi.app.Constant;
import com.colin.aiyi.entity.response.LoginResponse;
import com.colin.aiyi.entity.User;
import com.colin.aiyi.presenter.Interface.Callback;

import org.xutils.http.RequestParams;

/**
 * Created by hl on 2017/5/5.
 */
@Deprecated
public class ImpLogin extends AbsServicexUtils<User> {


 /*   tel	是	string	用户名
    password	是	string	密码*/
    @Override
    public void getTByParameter(Callback<User> callback, String... type) {
        super.getTByParameter(callback, type);
        RequestParams params=new RequestParams(Constant.login);
//        params.addBodyParameter("clientId",Constant.CLIENT_ID);
//        params.addBodyParameter("clientSecret",Constant.CLIENT_SECRET);
        params.addBodyParameter("tel",type[0]);
        params.addBodyParameter("password",type[1]);
        sendToServer(params);
    }


    @Override
    public void onSuccess(String result) {
        super.onSuccess(result);
        LoginResponse loginResponse=gson.fromJson(result, LoginResponse.class);
        callback.onSuccess(loginResponse);
    }
}
